package com.cuit.util;

import org.apache.commons.beanutils.BeanUtils;

import java.util.Map;

public class WebUtils {
    public static <E> E copyParamToBean(Map value, E bean) {
        try {
            BeanUtils.populate(bean, value);
        } catch (Exception e) {
           e.printStackTrace();
        }
        return bean;
    }

    public static int parseInt(String StrInt, int defaultValue) {
        try {
            return Integer.parseInt(StrInt);
        } catch (Exception e) {
//          e.printStackTrace();
        }
        return defaultValue;
    }
}
